home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / taropyon / guilib3 / inc / mouse.h < prev    next >
C/C++ Source or Header  |  1993-11-30  |  2KB  |  79 lines

  1. /*    :*****************************************************************
  2.     :    "mouse.h"    :    system“Pride”マウス・ライブラリ
  3.     :*****************************************************************
  4. */
  5. #ifndef    _MOUSE_H
  6. #define    _MOUSE_H
  7.  
  8. #ifndef    _GUIDEFS_H
  9. #    include    "guidefs.h"
  10. #endif
  11.  
  12. extern    int        MosSw;
  13. extern    int        MosX;
  14. extern    int        MosY;
  15. extern    SHORT    DspStartYmin;
  16. extern    SHORT    DspStartYmax;
  17. extern    SHORT    DspStartXmin;
  18. extern    SHORT    DspStartXmax;
  19. extern    char    MosHitFlag;
  20.  
  21. extern    int        MOS_pget(int *x,int *y);
  22. extern    int        MOS_Vpget( int *x, int *y);
  23. extern    int        MOS_moveArea( int x1, int y1, int x2, int y2 );
  24. extern    int        MOS_initMoveArea(void);
  25. extern    void    MOS_curDisp(int n);
  26. extern    void    MOS_curType(int no);
  27.  
  28. #define    MOS_CON()    MOS_curDisp(1)
  29. #define    MOS_COFF()    MOS_curDisp(0)
  30. #define    MOS_DEC()    MOS_curDisp(2)
  31. #define    MOS_INC()    MOS_curDisp(3)
  32.  
  33. /*    "moslib1.c"    ----------------------------------------------------*/
  34. typedef    struct
  35. {    UCHAR    page;        /* 表示ページ        */
  36.     char    ignore;
  37.     char    dsp;        /* 表示フラグ        */
  38.     char    dmy_1;
  39.     SHORT    curptn;        /* カーソルパターン    */
  40.     SHORT    dmy_2;
  41.     FRAME    move;        /* 移動範囲            */
  42. } MOSTK_T;
  43. #define    MOSTK    MOSTK_T
  44.  
  45. extern    void    MOS_moveFrame( FRAME *fr );
  46. extern    MOSTK_T    *MOS_push();
  47. extern    void    MOS_pop( MOSTK_T *mosTk );
  48.  
  49. /*    "moslib2.c"    ----------------------------------------------------*/
  50. typedef    struct
  51. {    FRAME    move;        /* 移動範囲            */
  52.     POINT    pos;
  53.     POINT    newPos;
  54. } MOSTKP_T;
  55. #define    MOSTKP    MOSTKP_T
  56.  
  57. extern    void    MOS_setPos(int x, int y);
  58. extern    MOSTKP    *MOS_pushPos( FRAME *newArea, int newXofs, int newYofs );
  59. extern    void    MOS_popPos( MOSTKP *mosTkP );
  60.  
  61.  
  62. /*    :-----------------------------------------------------------------
  63.     :    表示画面座標から仮想画面座標に変換するマクロ
  64.     :    page 1 ⇒ page 0 (scroll)
  65.     :-----------------------------------------------------------------
  66. */
  67. #define    ScnStoVX(_x)    ((_x)+DspCtrl.scinf[MosInf.scrollPage&1].dspstart.x)
  68. #define    ScnStoVY(_y)    ((_y)+DspCtrl.scinf[MosInf.scrollPage&1].dspstart.y)
  69.  
  70. /*    :-----------------------------------------------------------------
  71.     :    仮想画面座標から表示画面座標に変換するマクロ
  72.     :    page 0(scroll) ⇒ page 1
  73.     :-----------------------------------------------------------------
  74. */
  75. #define    ScnVtoSX(_x)    ((_x)-DspCtrl.scinf[MosInf.scrollPage&1].dspstart.x)
  76. #define    ScnVtoSY(_y)    ((_y)-DspCtrl.scinf[MosInf.scrollPage&1].dspstart.y)
  77.  
  78. #endif
  79.